<template>
  <s-table :dataSource="dataSource" :columns="columns">
  </s-table>
</template>

<script>
import { STable } from '@/components'

export default {
  name: 'TableList',
  components: {
    STable
  },
  data () {
    return {
      mdl: {},
      // 高级搜索 展开/关闭
      advanced: false,
      // 查询参数
      queryParam: {},
      dataSource: [
        {
          id: 1,
          cover: 'https://gw.alipayobjects.com/zos/rmsportal/WdGqmHpayyMjiEhcKoVE.png',
          title: 'Alipay',
          description: '那是一种内在的东西， 他们到达不了，也无法触及的',
          status: 1,
          updatedAt: '2018-07-26 00:00:00'
        },
        {
          id: 2,
          cover: 'https://gw.alipayobjects.com/zos/rmsportal/zOsKZmFRdUtvpqCImOVY.png',
          title: 'Angular',
          description: '希望是一个好东西，也许是最好的，好东西是不会消亡的',
          status: 1,
          updatedAt: '2018-07-26 00:00:00'
        },
        {
          id: 3,
          cover: 'https://gw.alipayobjects.com/zos/rmsportal/dURIMkkrRFpPgTuzkwnB.png',
          title: 'Ant Design',
          description: '城镇中有那么多的酒馆，她却偏偏走进了我的酒馆',
          status: 1,
          updatedAt: '2018-07-26 00:00:00'
        },
        {
          id: 4,
          cover: 'https://gw.alipayobjects.com/zos/rmsportal/sfjbOqnsXXJgNCjCzDBL.png',
          title: 'Ant Design Pro',
          description: '那时候我只会想自己想要什么，从不想自己拥有什么',
          status: 1,
          updatedAt: '2018-07-26 00:00:00'
        },
        {
          id: 5,
          cover: 'https://gw.alipayobjects.com/zos/rmsportal/siCrBXXhmvTQGWPNLBow.png',
          title: 'Bootstrap',
          description: '凛冬将至',
          status: 1,
          updatedAt: '2018-07-26 00:00:00'
        },
        {
          id: 6,
          cover: 'https://gw.alipayobjects.com/zos/rmsportal/ComBAopevLwENQdKWiIn.png',
          title: 'Vue',
          description: '生命就像一盒巧克力，结果往往出人意料',
          status: 1,
          updatedAt: '2018-07-26 00:00:00'
        }
      ],
      // 表头
      columns: [
        {
          title: '规则编号',
          dataIndex: 'id'
        }
      ],
      // 加载数据方法 必须为 Promise 对象
      loadData: (parameter) => {
        console.log('loadData.parameter', parameter)
        // 新增
        new Promise((resolve, reject) => {
          setTimeout(() => {
            resolve()
          }, 1000)
        }).then((res) => {
          var ress = {
            data: [
              {
                id: 1,
                cover: 'https://gw.alipayobjects.com/zos/rmsportal/WdGqmHpayyMjiEhcKoVE.png',
                title: 'Alipay',
                description: '那是一种内在的东西， 他们到达不了，也无法触及的',
                status: 1,
                updatedAt: '2018-07-26 00:00:00'
              },
              {
                id: 2,
                cover: 'https://gw.alipayobjects.com/zos/rmsportal/zOsKZmFRdUtvpqCImOVY.png',
                title: 'Angular',
                description: '希望是一个好东西，也许是最好的，好东西是不会消亡的',
                status: 1,
                updatedAt: '2018-07-26 00:00:00'
              },
              {
                id: 3,
                cover: 'https://gw.alipayobjects.com/zos/rmsportal/dURIMkkrRFpPgTuzkwnB.png',
                title: 'Ant Design',
                description: '城镇中有那么多的酒馆，她却偏偏走进了我的酒馆',
                status: 1,
                updatedAt: '2018-07-26 00:00:00'
              },
              {
                id: 4,
                cover: 'https://gw.alipayobjects.com/zos/rmsportal/sfjbOqnsXXJgNCjCzDBL.png',
                title: 'Ant Design Pro',
                description: '那时候我只会想自己想要什么，从不想自己拥有什么',
                status: 1,
                updatedAt: '2018-07-26 00:00:00'
              },
              {
                id: 5,
                cover: 'https://gw.alipayobjects.com/zos/rmsportal/siCrBXXhmvTQGWPNLBow.png',
                title: 'Bootstrap',
                description: '凛冬将至',
                status: 1,
                updatedAt: '2018-07-26 00:00:00'
              },
              {
                id: 6,
                cover: 'https://gw.alipayobjects.com/zos/rmsportal/ComBAopevLwENQdKWiIn.png',
                title: 'Vue',
                description: '生命就像一盒巧克力，结果往往出人意料',
                status: 1,
                updatedAt: '2018-07-26 00:00:00'
              }
            ],
            pageSize: 10,
            pageNo: 1,
            totalPage: 6,
            totalCount: 57
          }
          return ress
        })
      }
    }
  },
  created () {},
  methods: {}
}
</script>
